import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router)

import Main from '@/components/Main.vue';
import SM from '@/components/SystemMessages.vue';
import SE from '@/components/SystemEncode.vue'
import WHOM from '@/components/WHOM_SelectZB.vue';
import WHOMinsert from '@/components/WHOMInsert.vue';
import Heade from '@/components/Header.vue';
import Manba2 from '@/components/Manba.vue';
import Manba3 from '@/components/MainInterface.vue';
import ROMA  from '@/components/Role Management.vue';
import pro  from '@/components/Loginpromax.vue';
const router = new Router({
    mode: 'history',
    routes:[
        {
            path:"/login",
            name:"/login",
            component:pro
        },
        
        {
            path: "/",
            redirect: 'login'
        },
        {
            name:"mainba",
            path:"/mainba",
            component: Manba2,
            children:[
              {
                path: "/mainba",
                redirect:'/WHOM_SelectZB'
              },
                {
                    name: "WHOM_SelectZB",
                    path:'/WHOM_SelectZB',
                    component: () => import('../components/WHOM_SelectZB.vue')
                },
                {
                    name:'sm',
                    path:'/sm',
                    component: () => import('../components/SystemMessages.vue')
                },
                {
                    name:'se',
                    path:'/se',
                    component: () => import('../components/SystemEncode.vue')
                },
                {
                    name:'WHOMinsert',
                    path:'/WHOMinsert',
                    component: () => import('../components/WHOMInsert.vue')
                },
                {
                  name:'ROMA',
                  path:'/Role Management',
                  component: () => import('../components/Role Management.vue')
                },
                {
                    name:'c',
                    path:'/BsItemType',
                    component: () => import('../components/BsItemType.vue')
                },
                {
                    name:'IM',
                    path:'/InventoryManagement',
                    component: () => import('../components/InventoryManagement.vue')
                },
                {
                    name:'WHOM_JHXQ',
                    path:'/WHOM_JHXQ',
                    component: () => import('../components/WHOM_JHXQ.vue')
                },
                {
                    name:'WHOMUpdate',
                    path:'/WHOMUpdate',
                    component:() => import('../components/WHOMUpdate.vue')
                },
                {
                    name:'ADDRKGL',
                    path:'/ADDRKGL',
                    component:() => import('../components/RKGL/ADDRKGL.vue')
                },
                {
                    name:'RKGL_SelectZB',
                    path:'/RKGL_SelectZB',
                    component:() => import('../components/RKGL/RKGL_SelectZB.vue')
                },
                {
                    name:'UpdateRKGL',
                    path:'/UpdateRKGL',
                    component:() => import('../components/RKGL/UpdateRKGL.vue')
                },
                {
                    name:'WHOM_XsZB',
                    path:'/WHOM_XsZB',
                    component:() => import('../components/XSDD/WHOM_XsZB.vue')
                },
                {
                    name:'ADDXSDD',
                    path:'/ADDXSDD',
                    component:() => import('../components/XSDD/ADDXSDD.vue')
                },
                {
                    name:'UpdateXSDD',
                    path:'/UpdateXSDD',
                    component:() => import('../components/XSDD/UpdateXSDD.vue')
                },
                {
                    name:'XSDD_XSXQ',
                    path:'/XSDD_XSXQ',
                    component:() => import('../components/XSDD/XSDD_XSXQ.vue')
                },
              {
                name:'BST',
                path:'/BsItemType',
                component: () => import('../components/BsItemType.vue')
            },
            {
                name:"SLY",
                path:'/Supply',
                component: () => import('../components/Supply.vue')
            },
            {
                name:"Bi",
                path:'/BsItem',
                component: () => import('../components/BsItem.vue')
            },
            {
                name:"ABIs",
                path:'/AddBsItem', 
                component: () => import('../components/AddBsItem.vue')
            },
            {
                name:"UpaProduct_information",
                path:'/UpaProduct_information',
                component: () => import('../components/UpaProduct_information.vue')
            },
            {
                name:"Product_information",
                path:'Product_information',
                component: () => import('../components/Product_information.vue')
            },
            {
                name:'Warehouse_management',
                path:'/Warehouse_management',
                component: () => import('../components/Warehouse_management.vue')
            },
            {
                name:'AddWarehouse',
                path:'/AddWarehouse',
                component: () => import('../components/AddWarehouse.vue')
            },
            {
            name:'Warehouse_information',
            path:'/Warehouse_information',
            component: () => import('../components/Warehouse_information.vue')
            },
            {
                name:'UpdateWarehouse',
                path:'/UpdateWarehouse',
                component: () => import('../components/UpdateWarehouse.vue')
            }
            ]
        }
    ]
})

const VueRouterPush = Router.prototype.push
Router.prototype.push = function push (to){
    return VueRouterPush
    .call(this, to)
    .catch(err => err)}

export default router